<?php
/**
 * 
 * @author Radovan Dvorsky
 * @version 20100604
 *
 */
class Form_Professor_Add extends Zend_Form{
	
	
	function __construct($options = null) {		
		parent::__construct($options);
		
		$this->setMethod('post');
		$this->addDecorator('Fieldset',array('legend' => 'Pridať porofesora'));
		
		$titleBefore = new Zend_Form_Element_Text('title_before');
		$titleBefore->setRequired(false)
		->addValidator('StringLength',false,array(2,25))
		->addFilter('StringTrim')
		->setLabel("Titul pred menom");
		
		
		$firstName = new Zend_Form_Element_Text('firstname');
		$firstName->setRequired(true)		
		->addValidator('alpha')
		->addValidator('StringLength',false,array(2,25))
		->addFilter('StringTrim')
		->setLabel('Meno');
		
		$lastName = new Zend_Form_Element_Text('lastname');
		$lastName->setRequired(true)		
		->addValidator('alpha')
		->addValidator('StringLength',false,array(2,25))
		->addFilter('StringTrim')
		->setLabel('Priezvisko');
		
		$titleBehind = new Zend_Form_Element_Text('title_behind');
		$titleBehind->setRequired(false)
		->addValidator('StringLength',false,array(2,15))
		->addFilter('StringTrim')
		->setLabel("Titul za menom");
		
		$pidHiden = new Zend_Form_Element_Hidden('pid');
		
		$submit = new Zend_Form_Element_Submit('submitProfessor');
		$submit->setLabel('Pridať');
		
		$this->addElements(array($titleBefore,$firstName,$lastName,$titleBehind,$pidHiden));		
	}
}